package main

import (
	"fmt"

	"github.com/olivere/elastic/v7"
)

var url = []string{"http://127.0.0.1:9200"}

func main() {
	es, err := elastic.NewClient(elastic.SetURL(url...))
	if err != nil {
		panic(err)
	}
	esversion, err := es.ElasticsearchVersion("http://127.0.0.1:9200")
	if err != nil {
		panic(err)
	}
	fmt.Printf("es version %s\n", esversion)
}
